home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4084 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1014 b 

  1. Path: news.u.washington.edu!gah
  2. From: gah@u.washington.edu (G. Herrmannsfeldt)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Why isn't return address in the stack protected?
  5. Date: 1 Feb 1996 21:25:20 GMT
  6. Organization: University of Washington
  7. Message-ID: <4erb40$7eb@nntp5.u.washington.edu>
  8. References: <DLo4xF.MH@un.seqeb.gov.au> <1996Jan24.032914.8805@ohstpy> <4e5qfv$1587@ns.RezoNet.NET>
  9. NNTP-Posting-Host: saul2.u.washington.edu
  10. NNTP-Posting-User: gah
  11.  
  12. I agree that staying in bounds is the programmers responsibility, but I
  13. think also that sprintf should not be written this way.  It is sometimes
  14. difficult to predict the size of an output string from sprintf, and one
  15. should not be forced to allocate the maximum possible size.
  16.  
  17. Note that a floating point number in %f format could take a very large number
  18. of characters to describe.  There are machines with floating point numbers
  19. in the 10^4000 range, or so, which could take 4000 characters if printed in %f.
  20.  
  21. Maybe we need sprintfn(format,size,arg1...);
  22.  
  23. -- glen
  24.